package no.hib.mod250.chat.client.view;

import no.hib.mod250.chat.client.controller.ChatController;
import no.hib.mod250.chat.client.controller.Controller;
import no.hib.mod250.chat.client.service.ChatService;

import com.google.gwt.user.client.ui.Composite;

public abstract class View extends Composite {

	// CLASSES

	public interface StatusObserver {

		public void onStatusServerCameBack();

		public void onStatusServerWentAway();

		public void onStatusTaskFinished(Controller.Task task);

		public void onStatusTaskStarted(Controller.Task task);

	}

	public interface DataObserver {

		public void onDataResult(ChatService.Result result);

	}

	// /CLASSES

	// VARIABLES

	protected final ChatController controller;

	// /VARIABLES

	// CONSTRUCTOR

	public View(final ChatController controller) {
		this.controller = controller;
	}

	// /CONSTRUCTOR

	// FUNCTIONS

	protected ChatController getController() {
		return this.controller;
	}

	/**
	 * Drawing code should be called here. Remember to call this function in the
	 * constructor.
	 */
	protected abstract void doDraw();

	// /FUNCTIONS

}
